<div  ng-init="initQuery()">
    <form class="form-horizontal" role="form" novalidate name="myForm">
      <div class="form-ctrl md-whiteframe-z1">
        <div class="form-search" style="height:190px;" ng-class="{'shou':!flag.state}" ng-switch on=sendData.timeTypeCode>
          <div style="width: 250px">
            <label>统计方式</label>
            <md-select  ng-model="sendData.timeTypeCode" placeholder="月">
              <md-option ng-value="item.timeTypeCode" ng-repeat="item in timeTypes">{{item.timeTypeName}}</md-option>
            </md-select>
          </div>
          <div ng-switch-when="1">
            <label>时间</label>
            <md-input-container flex>
              <label>&nbsp;</label>
              <input type="date" required name="date" ng-model="sendData.date" time-validate="day" />
              <div ng-messages="myForm.date.$error">
                <div ng-message="date">请正确输入时间</div>
                <div ng-message="too-great">时间不应大于当前时间</div>
              </div>
            </md-input-container>
          </div>
          <div ng-switch-when="3">
            <label>时间</label>
            <md-input-container flex>
              <label>&nbsp;</label>
              <input type="month" required name="month" ng-model="sendData.date" time-validate="month" />
              <div ng-messages="myForm.month.$error">
                <div ng-message="date">请正确输入时间</div>
                <div ng-message="too-great">时间不应大于当前时间</div>
              </div>
            </md-input-container>
          </div>
          <div ng-switch-when="5">
            <label>时间</label>
            <md-input-container flex>
              <label>&nbsp;</label>
              <input type="number" required name="year" ng-model="sendData.date" time-validate="year" />
              <div ng-messages="myForm.year.$error">
                <div ng-message="date">请正确输入时间</div>
                <div ng-message="too-great">时间不应大于当前时间</div>
              </div>
            </md-input-container>
          </div>
        </div>
        <i class="glyphicon glyphicon-chevron-up shrinkage" ng-hide="myForm.$invalid || flag.arrow" ng-click="flag.state = false"></i>
        <md-button ng-disabled="myForm.$invalid" ng-click="search()" class="md-fab md-primary md-hue-1" aria-label="Profile">
          <i class="glyphicon glyphicon-arrow-down" style="margin-top:28px;" ng-show="!flag.state"></i>
          <i class="glyphicon glyphicon-search" ng-show="flag.state"></i>
        </md-button>
      </div>
    </form>
  </div>
  <div class="menus" ng-show="flag.show">
    <form action="{{exportUrl}}" target="_black" method="post">
      <input type='hidden' name="data" value='{{exportParam}}'>
      <md-button type="submit" class="md-raised">导出Excel</md-button>
    </form>
  </div>
  <div class="table-info" ng-show="flag.show">
    <div class="table-detail">
      <div class="t_r">
        <table class="table table-bordered " style="vertical-align: middle;">
          <caption style="text-align:center;font-size:large;font-weight:bold;color:black">{{title}}</caption>
          <thead>
            <tr>
              <th rowspan="2">分类</th>
              <th rowspan="2">统一支付平台交易总量(笔)</th>
              <th rowspan="2">统一支付平台交易的成功量(笔)</th>
              <th rowspan="2">统一支付平台交易的失败量(笔)</th>
              <th colspan="3">统一支付自身导致的失败交易</th>
            </tr>
            <tr>
              <th>错误类型</th>
              <th>错误描述</th>
              <th>交易失败量(笔)</th>
            </tr>
          </thead>
          <tbody>
            <tr ng-repeat="t in items">
              <td><span ng-bind="t.platformName"></span></td>
              <td><span ng-bind="t.tradeCount"></span></td>
              <td><span ng-bind="t.tradeSuccess"></span></td>
              <td><span ng-bind="t.tradeFail"></span></td>
              <td ng-if="$index ==0|| $index ==2" rowspan="2">
                <span ng-bind="t.errorType"></span>
              </td>
              <td ng-if="$index ==0 || $index ==2" rowspan="2">
                <span ng-bind="t.errorDescribe"></span>
              </td>
              <td ng-if="$index ==0 || $index ==2" rowspan="2">
                <span ng-bind="t.transactionFail"></span>
              </td>
            </tr>
            <tr class="summary">
              <td>汇总</td>
              <td>{{data.totalTradeCount}}</td>
              <td>{{data.totalTradeSuccess}}</td>
              <td>{{data.totalTradeFail}}</td>
              <td>汇总</td>
              <td colspan="2">{{data.totalTransactionFail}}</td>
            </tr>
            <tr>
              <td colspan="4">统一支付考核结果得分</td>
              <td colspan="3">{{data.accessResultScore+'分'}}</td>
            </tr>
            <tr>
              <td colspan="4">统一支付系统实际成功率</td>
              <td colspan="3">{{data.successRate}}</td>
            </tr>
          </tbody>
        </table>
      </div>
    </div>
  </div>
